{% extends 'base.html' %}
{% load staticfiles %}
{% load filter %}
{% block title %}{{ name }} - luckydog幸运儿{% endblock title %}
{% block main %}
<div class="col-xs-12 col-sm-9">
    <div class="row">
        <!-- 文章 -->
        <div class="col-xs-12">
            <h3>文章列表</h3>
            <div class="list-group">
                {% for article in articles %}
                    {# 传递路由给article_detail #}
                    <a href="{% url 'article_detail' article.id %}" class="list-group-item"><span class="badge">
                        {#通过length过滤器得到含有html标签的文本长度，#}
                        {#通过striptags得到取出html标签后的文本内容#}
                        {#通用的阅读速度是文章的长度处于300得到的就是阅读的时长#}
                        {{ article.content|striptags|length }}字符，约{{ article.content|striptags|length|spendTime }}分钟</span>
                        {{ article.updated|date:"Y-m-d" }} · <b>{{ article.title }}</b>
                    </a>
                {% endfor %}

            </div>
        </div>
        {#引入标签云#}
        {% include 'article/tag.html' %}
        <!-- 分页码，« »，选中class="active"，超过四个同时显示，那么就缩略-->
        {# <li class="active"> #}
        {% include 'article/paginator.html' %}
    </div>
</div>
{% endblock main %}